using Admin2024.Domain.Entity.System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace Admin2024.EntityFrameworkCore.EntityConfiguration;

public class AppFileUploadConfiguration : BaseEntityConfiguration<AppFileUpload>
{
    public override void Configure(EntityTypeBuilder<AppFileUpload> builder)
    {
        base.Configure(builder);

        //表名
        builder.ToTable("app_file_upload");
        //自有属性
        builder.Property(p => p.FileName)
        .HasColumnName("file_name")
        .HasComment("文件名称")
        .HasColumnOrder(3);

        builder.Property(p=>p.RelativePath)
        .HasColumnName("relative_path")
        .HasComment("文件路径")
        .HasColumnOrder(4);

        // builder.Property(p => p.FileSize)
        // .HasColumnName("file_size")
        // .HasComment("文件大小")
        // .HasColumnOrder(5);

        builder.Property(p=>p.ContentType)
        .HasColumnName("content_type")
        .HasComment("文件类型")
        .HasColumnOrder(6);
    }
}